rule "${ruleGroupInfo.ruleName}"
salience #{salience!0}
no-loop true
    when
        $insertMap: Map(
            eval(isInList(this["${ruleGroupInfo.preRuleName}_trigger_info"], "${ruleGroupInfo.ruleName}")) == false<#if hitToExitFlag||(ruleGroupInfo.whenStack?? && ruleGroupInfo.whenStack?size != 0)>,</#if>
    <#if hitToExitFlag>
            (this["${parentRuleName}_flag"] == null || this["${parentRuleName}_flag"] == true)<#if hitToExitFlag&&ruleGroupInfo.whenStack?? && ruleGroupInfo.whenStack?size != 0>,</#if>
    </#if>
    <#if ruleGroupInfo.whenStack?? && ruleGroupInfo.whenStack?size != 0>
        <#list 0..(ruleGroupInfo.whenStack!?size-1) as i>
            (${ruleGroupInfo.whenStack[i]})<#if i != ruleGroupInfo.whenStack!?size-1>,</#if>
        </#list>
    </#if>
        )
    then
    <#if hitToExitFlag>
        $insertMap.put("${parentRuleName}_flag", false);
    </#if>
        if (!$insertMap.containsKey("${parentRuleName}")) {
            $insertMap.put("${parentRuleName}", new HashSet<String>());
        }
        HashSet<String> hashSet = (HashSet<String>) $insertMap.get("${parentRuleName}");
        hashSet.add("${ruleGroupInfo.ruleName}");

        if (!$insertMap.containsKey("${ruleGroupInfo.preRuleName}_trigger_info")) {
            $insertMap.put("${ruleGroupInfo.preRuleName}_trigger_info", new ArrayList<String>());
        }
        List<String> triggerInfoList = (ArrayList<String>) $insertMap.get("${ruleGroupInfo.preRuleName}_trigger_info");
        triggerInfoList.add("${ruleGroupInfo.ruleName}");

        update($insertMap);
end
